package org.jeecg.modules.demo.temple.order.service.impl;

import org.jeecg.modules.demo.temple.order.entity.TempleDonationOrder;
import org.jeecg.modules.demo.temple.order.mapper.TempleDonationOrderMapper;
import org.jeecg.modules.demo.temple.order.service.ITempleDonationOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description: 供养订单表
 * @Author: jeecg-boot
 * @Date: 2022-05-04
 * @Version: V1.0
 */
@Service
public class TempleDonationOrderServiceImpl extends ServiceImpl<TempleDonationOrderMapper, TempleDonationOrder> implements ITempleDonationOrderService {
    @Autowired
    private TempleDonationOrderMapper templeDonationOrderMapper;

    /**
     *
     * @Description 获取捐赠项目人数和金额
     * @date 2022/5/16 16:53
     * @param id
     * @return Map
     */

    @Override
    public Map totalNumMoney(String id) {
        return templeDonationOrderMapper.totalNumMoney(id);

    }

    /**
     * @Description 设置支付支付状态
     * @param isPay Y：已支付; N：未支付
     * @param list  符合条件的id
     */
    @Override
    public void setIsPayState(String isPay, List list) {
        templeDonationOrderMapper.setIsPayState(isPay,list);
    }

    @Override
    public Map todayDonationData(String sys_org_code) {
        Map todayDonationData = templeDonationOrderMapper.todayDonationData(sys_org_code);
        return  todayDonationData;
    }

    @Override
    public List<Map> classifyDonationData(String sys_org_code) {
        List<Map> classifyDonationData = templeDonationOrderMapper.classifyDonationData(sys_org_code) ;
         return classifyDonationData;
    }
    /**
     *
     * @Description 近七天的捐赠数据
     * @date 2022/6/15 9:08
     * @param sys_org_code
     * @return List<Map>
     */

    @Override
    public List<Map> donation7DayData(String sys_org_code) {
        List<Map> donation7DayData = templeDonationOrderMapper.donation7DayData(sys_org_code);
        return donation7DayData;
    }

    /**
     *
     * @Description 近一个月捐赠数据
     * @date 2022/6/15 9:10
     * @param sys_org_code
     * @return List<Map>
     */

    @Override
    public List<Map> donationOneMonthData(String sys_org_code) {
        List<Map> donationOneMonthData = templeDonationOrderMapper.donationOneMonthData(sys_org_code);
        return donationOneMonthData;
    }
    /**
     *
     * @Description 近三个月捐赠数据
     * @date 2022/6/15 9:11
     * @param sys_org_code
     * @return List<Map>
     */
    @Override
    public List<Map> donationThreeMonthData(String sys_org_code) {
        List<Map> donationThreeMonthData = templeDonationOrderMapper.donationThreeMonthData(sys_org_code);
        return donationThreeMonthData;
    }

    /**
     *
     * @Description 近半年捐赠数据
     * @date 2022/6/15 9:12
     * @param sys_org_code
     * @return List<Map>
     */

    @Override
    public List<Map> donationHalfData(String sys_org_code) {
        List<Map> donationHalfData = templeDonationOrderMapper.donationHalfData(sys_org_code);
        return donationHalfData;
    }

    /**
     *
     * @Description 近一年数据
     * @date 2022/6/15 9:12
     * @param sys_org_code
     * @return List<Map>
     */


    @Override
    public List<Map> donationOneYearData(String sys_org_code) {
        List<Map> donationOneYearData = templeDonationOrderMapper.donationOneYearData(sys_org_code);
        return donationOneYearData;
    }


    @Override
    public List<Map> donationDashBoardQuery(String sys_org_code, String begin, String end) {
        List<Map> donationDateQuery = templeDonationOrderMapper.donationDashBoardQuery(sys_org_code, begin, end);
        return donationDateQuery;
    }


}
